<?php

namespace common\entities\myhtsq;

use common\entities\ContractEntity;
use Yii;

/**
 * This is the model class for table "myscrm_contract_receivable".
 *
 * @property string $receivable_id
 * @property string $contract_id
 * @property string $receivable_item_id
 * @property string $money_category_item_id
 * @property string $revenue_type
 * @property string $receivable_amount
 * @property string $receivable_date
 * @property string $payee_id
 * @property string $department_id
 * @property string $professional_line_id
 * @property string $payment_condition
 * @property string $billing_amount
 * @property string $received_amount
 * @property integer $is_bad_debt
 * @property integer $is_operation
 * @property integer $receivable_type
 * @property string $remark
 * @property string $created_on
 * @property string $created_by
 * @property string $modified_on
 * @property string $modified_by
 * @property string $old_receivable_id
 * @property string $bad_debt_reason
 * @property string $bad_debt_date
 * @property string $performance_accounting_time
 */
class ContractReceivableEntity extends ContractEntity
{

    /**
     * @inheritdoc
     */
    public static function tableName() {
        return 'myscrm_contract_receivable';
    }

    /**
     * @inheritdoc
     */
    public function rules() {
        return [

            [['receivable_id', 'contract_id'], 'required'],
            [['is_bad_debt', 'is_operation'], 'integer'],
            [['receivable_amount', 'billing_amount', 'received_amount'], 'number'],
            [['receivable_date', 'created_on', 'modified_on','performance_accounting_time'], 'safe'],
            [['payment_condition', 'remark', 'bad_debt_reason', 'bad_debt_date' ,'receivable_type'], 'string'],
            [['receivable_id', 'contract_id', 'receivable_item_id', 'money_category_item_id', 'payee_id', 'department_id', 'professional_line_id', 'created_by', 'modified_by', 'revenue_type', 'unite_sales_id', 'old_receivable_id'], 'string', 'max' => 36]

        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels() {
        return [
            'receivable_id' => '应收款ID',
            'contract_id' => '合同ID',
            'receivable_item_id' => '应收款项条目ID',
            'money_category_item_id' => '款项类别条目ID',
            'revenue_type' => '关联收入项类型',
            'receivable_amount' => '应收款金额',
            'receivable_date' => '应收日期',
            'payee_id' => '收款责任人ID',
            'department_id' => '收款责任部门ID',
            'professional_line_id' => '收款责任专业线ID',
            'payment_condition' => '付款条件',
            'billing_amount' => '已开票金额',
            'received_amount' => '已收金额',
            'is_bad_debt' => '是否坏账',
            'is_operation' => '是否运营关注项',
            'remark' => '备注',
            'created_on' => '创建时间',
            'created_by' => '创建人',
            'modified_on' => '修改时间',
            'modified_by' => '修改人',
            'unite_sales_id' => '云客售前人员ID',
            'receivable_type' => '合同类型',
            'old_receivable_id' => '拆分来源父级ID',
            'bad_debt_reason' => '坏账原因',
            'bad_debt_date' => '标记坏账时间',
            'performance_accounting_time' => '业绩核算时间',
        ];
    }

}
